import java.util.Locale;

public class TestDome {
    public  static  boolean isNumOrCharacter(char ch){
        if(ch>='0'&&ch<='9'||ch>='a'&&ch<='z'){
            return true;
        }
        return false;
    }
    public  boolean isPalindrome(String s){
        s=s.toLowerCase();
        int i = 0;
        int j = s.length()-1;
        while(i<j){
                while(i<j&&isNumOrCharacter(s.charAt(i))==false){
                    i++;
                }
                while(i<j&&isNumOrCharacter(s.charAt(j))==false){
                    j--;
                }

                if(s.charAt(i)==s.charAt(j)){
                    i++;
                    j--;
                }else{
                    return false;
                }
            }
        return true;
    }

    public static void main(String[] args) {

    }
}
